<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <script src="js/工厂模式1.js"></script>
    <script>
         var carFactory = new VehicleFactory();
//         var car = carFactory.createVehicle( {
//             vehicleType: "car",
//             color: "yellow",
//             doors: 6 } );
//         // Test to confirm our car was created using the vehicleClass/prototype Car
//         // Outputs: true
//         console.log( car instanceof Car );
//         // Outputs: Car object of color "yellow", doors: 6 in a "brand new" state
//         console.log( car );
         var movingTruck = carFactory.createVehicle( {
             vehicleType: "truck",
             state: "like new",
             color: "red",
             wheelSize: "small" } );
         // Test to confirm our truck was created with the vehicleClass/prototype Truck

         // Outputs: true
         console.log( movingTruck instanceof Truck );
         // Outputs: Truck object of color "red", a "like new" state
         // and a "small" wheelSize
         console.log( movingTruck );
    </script>
</body>
</html>